package cn.seecoder.courselearning.po.course;

import cn.seecoder.courselearning.vo.course.CommentsVO;
import lombok.NonNull;

import java.util.Date;

public class Comments {

    /**
     * 帖子id
     */
    private Integer id;

    /**
     * 标题
     */
    private String title;

    /**
     * 副标题
     */
    private String subTitle;

    /**
     * 摘要
     */
    private String abstraction;

    /**
     * 课程id
     */
    private Integer courseId;

    /**
     * 创建帖子的时间
     */
    private Date createTime;

    /**
     * 发表用户id
     */
    private Integer uid;

    /**
     * 用户名字
     */
    private String uname;

    /**
     * 最新回复时间
     */
    private Date updateT;

    public Date getUpdateT() {
        return updateT;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateT = updateT;
    }


    public String getAbstraction() {
        return abstraction;
    }

    public void setAbstraction(String abstraction) {
        this.abstraction = abstraction;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUname() {
        return uname;
    }

    public void setUname(String uname) {
        this.uname = uname;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getsubTitle() {
        return subTitle;
    }

    public void setsubTitle(String subTitle) {
        this.subTitle = subTitle;
    }

    public Integer getCourseId() {
        return courseId;
    }

    public void setCourseId(Integer courseId) {
        this.courseId = courseId;
    }


    public Comments(Integer id, String title, String subTitle, String abstraction, Integer courseId, Date createTime, Integer uid, String uname, Date updateT) {
        this.id = id;
        this.title = title;
        this.subTitle = subTitle;
        this.abstraction = abstraction;
        this.courseId = courseId;
        this.createTime = createTime;
        this.uid = uid;
        this.uname = uname;
        this.updateT = updateT;
    }

    public Comments(@NonNull CommentsVO commentsVO) {
        this.abstraction = commentsVO.getAbstraction();
        this.courseId = commentsVO.getCourseId();
        this.createTime = commentsVO.getCreateTime();
        this.id = commentsVO.getId();
        this.subTitle = commentsVO.getSubTitle();
        this.title = commentsVO.getTitle();
        this.uid = commentsVO.getUid();
        this.uname = commentsVO.getUname();
        this.updateT = commentsVO.getUpdateT();
    }
}
